<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP, TypeFamilies, ViewPatterns, OverloadedStrings #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- | This is the top-level module in the LLVM code generator.</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CmmToLlvm</span><span>
</span><span id="line-7"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmVersion"><span class="hs-identifier">LlvmVersion</span></a></span><span>
</span><span id="line-8"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#llvmVersionList"><span class="hs-identifier">llvmVersionList</span></a></span><span>
</span><span id="line-9"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.html#llvmCodeGen"><span class="hs-identifier">llvmCodeGen</span></a></span><span>
</span><span id="line-10"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Mangler.html#llvmFixupAsm"><span class="hs-identifier">llvmFixupAsm</span></a></span><span>
</span><span id="line-11"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-12"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Llvm.html"><span class="hs-identifier">GHC.Llvm</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html"><span class="hs-identifier">GHC.CmmToLlvm.Base</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.CodeGen.html"><span class="hs-identifier">GHC.CmmToLlvm.CodeGen</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Data.html"><span class="hs-identifier">GHC.CmmToLlvm.Data</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Ppr.html"><span class="hs-identifier">GHC.CmmToLlvm.Ppr</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Regs.html"><span class="hs-identifier">GHC.CmmToLlvm.Regs</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Mangler.html"><span class="hs-identifier">GHC.CmmToLlvm.Mangler</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.CgUtils.html"><span class="hs-identifier">GHC.StgToCmm.CgUtils</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.CgUtils.html#fixStgRegisters"><span class="hs-identifier">fixStgRegisters</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Ppr.html"><span class="hs-identifier">GHC.Cmm.Ppr</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.BufHandle.html"><span class="hs-identifier">GHC.Utils.BufHandle</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#platformArch"><span class="hs-identifier">platformArch</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Arch"><span class="hs-identifier">Arch</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.SysTools.html"><span class="hs-identifier">GHC.SysTools</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.SysTools.Tasks.html#figureLlvmVersion"><span class="hs-identifier">figureLlvmVersion</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html"><span class="hs-identifier">GHC.Data.Stream</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Stream</span></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier">when</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier">forM_</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier">fromMaybe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier">catMaybes</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-45"></span><span class="hs-comment">-- | Top-level of the LLVM Code generator</span><span>
</span><span id="line-46"></span><span class="hs-comment">--</span><span>
</span><span id="line-47"></span><span id="local-6989586621681017574"><span class="annot"><a href="GHC.CmmToLlvm.html#llvmCodeGen"><span class="hs-identifier hs-type">llvmCodeGen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>
</span><span id="line-48"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier hs-type">Stream.Stream</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681017574"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-49"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681017574"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-50"></span><span id="llvmCodeGen"><span class="annot"><span class="annottext">llvmCodeGen :: forall a. DynFlags -&gt; Handle -&gt; Stream IO RawCmmGroup a -&gt; IO a
</span><a href="GHC.CmmToLlvm.html#llvmCodeGen"><span class="hs-identifier hs-var hs-var">llvmCodeGen</span></a></span></span><span> </span><span id="local-6989586621681017347"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681017346"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681017346"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621681017345"><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681017345"><span class="hs-identifier hs-var">cmm_stream</span></a></span></span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; IO a -&gt; IO a
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var">withTiming</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LLVM CodeGen&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; a -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; IO a) -&gt; IO a -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-52"></span><span>       </span><span id="local-6989586621681017341"><span class="annot"><span class="annottext">BufHandle
</span><a href="#local-6989586621681017341"><span class="hs-identifier hs-var">bufh</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO BufHandle
</span><a href="GHC.Utils.BufHandle.html#newBufHandle"><span class="hs-identifier hs-var">newBufHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681017346"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>       </span><span class="hs-comment">-- Pass header</span><span>
</span><span id="line-55"></span><span>       </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; IO ()
</span><a href="GHC.Utils.Error.html#showPass"><span class="hs-identifier hs-var">showPass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LLVM CodeGen&quot;</span></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span>       </span><span class="hs-comment">-- get llvm version, cache for later use</span><span>
</span><span id="line-58"></span><span>       </span><span id="local-6989586621681017338"><span class="annot"><span class="annottext">Maybe LlvmVersion
</span><a href="#local-6989586621681017338"><span class="hs-identifier hs-var">mb_ver</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; IO (Maybe LlvmVersion)
</span><a href="GHC.SysTools.Tasks.html#figureLlvmVersion"><span class="hs-identifier hs-var">figureLlvmVersion</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>       </span><span class="hs-comment">-- warn if unsupported</span><span>
</span><span id="line-61"></span><span>       </span><span class="annot"><span class="annottext">Maybe LlvmVersion -&gt; (LlvmVersion -&gt; IO ()) -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LlvmVersion
</span><a href="#local-6989586621681017338"><span class="hs-identifier hs-var">mb_ver</span></a></span><span> </span><span class="annot"><span class="annottext">((LlvmVersion -&gt; IO ()) -&gt; IO ())
-&gt; (LlvmVersion -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681017337"><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017337"><span class="hs-identifier hs-var">ver</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-62"></span><span>         </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-63"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Using LLVM version:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVersion -&gt; String
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionStr"><span class="hs-identifier hs-var">llvmVersionStr</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017337"><span class="hs-identifier hs-var">ver</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017333"><span class="annot"><span class="annottext">doWarn :: Bool
</span><a href="#local-6989586621681017333"><span class="hs-identifier hs-var hs-var">doWarn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt"><span class="hs-identifier hs-var">wopt</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnsupportedLlvmVersion"><span class="hs-identifier hs-var">Opt_WarnUnsupportedLlvmVersion</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-65"></span><span>         </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVersion -&gt; Bool
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionSupported"><span class="hs-identifier hs-var">llvmVersionSupported</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017337"><span class="hs-identifier hs-var">ver</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681017333"><span class="hs-identifier hs-var">doWarn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier hs-var">putMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; IO ()) -&gt; SDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-66"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;You are using an unsupported version of LLVM!&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-67"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;Currently only&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVersion -&gt; String
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionStr"><span class="hs-identifier hs-var">llvmVersionStr</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="GHC.CmmToLlvm.Base.html#supportedLlvmVersionLowerBound"><span class="hs-identifier hs-var">supportedLlvmVersionLowerBound</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-68"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;to&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVersion -&gt; String
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionStr"><span class="hs-identifier hs-var">llvmVersionStr</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="GHC.CmmToLlvm.Base.html#supportedLlvmVersionUpperBound"><span class="hs-identifier hs-var">supportedLlvmVersionUpperBound</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;is supported.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-69"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;System LLVM version: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVersion -&gt; String
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionStr"><span class="hs-identifier hs-var">llvmVersionStr</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017337"><span class="hs-identifier hs-var">ver</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-70"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;We will try though...&quot;</span></span><span>
</span><span id="line-71"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017322"><span class="annot"><span class="annottext">isS390X :: Bool
</span><a href="#local-6989586621681017322"><span class="hs-identifier hs-var hs-var">isS390X</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformArch"><span class="hs-identifier hs-var">platformArch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Arch -&gt; Arch -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Arch
</span><a href="../../ghc-boot/src/GHC.Platform.html#ArchS390X"><span class="hs-identifier hs-var">ArchS390X</span></a></span><span>
</span><span id="line-72"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017319"><span class="annot"><span class="annottext">major_ver :: Int
</span><a href="#local-6989586621681017319"><span class="hs-identifier hs-var hs-var">major_ver</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Int
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">([Int] -&gt; Int) -&gt; (LlvmVersion -&gt; [Int]) -&gt; LlvmVersion -&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion -&gt; [Int]
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionList"><span class="hs-identifier hs-var">llvmVersionList</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmVersion -&gt; Int) -&gt; LlvmVersion -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017337"><span class="hs-identifier hs-var">ver</span></a></span><span>
</span><span id="line-73"></span><span>         </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681017322"><span class="hs-identifier hs-var">isS390X</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681017319"><span class="hs-identifier hs-var">major_ver</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681017333"><span class="hs-identifier hs-var">doWarn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#putMsg"><span class="hs-identifier hs-var">putMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; IO ()) -&gt; SDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-74"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;Warning: For s390x the GHC calling convention is only supported since LLVM version 10.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-75"></span><span>           </span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-string">&quot;You are using LLVM version: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVersion -&gt; String
</span><a href="GHC.CmmToLlvm.Base.html#llvmVersionStr"><span class="hs-identifier hs-var">llvmVersionStr</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017337"><span class="hs-identifier hs-var">ver</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>       </span><span class="hs-comment">-- HACK: the Nothing case here is potentially wrong here but we</span><span>
</span><span id="line-78"></span><span>       </span><span class="hs-comment">-- currently don't use the LLVM version to guide code generation</span><span>
</span><span id="line-79"></span><span>       </span><span class="hs-comment">-- so this is okay.</span><span>
</span><span id="line-80"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681017315"><span class="hs-identifier hs-type">llvm_ver</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmVersion"><span class="hs-identifier hs-type">LlvmVersion</span></a></span><span>
</span><span id="line-81"></span><span>           </span><span id="local-6989586621681017315"><span class="annot"><span class="annottext">llvm_ver :: LlvmVersion
</span><a href="#local-6989586621681017315"><span class="hs-identifier hs-var hs-var">llvm_ver</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmVersion -&gt; Maybe LlvmVersion -&gt; LlvmVersion
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="GHC.CmmToLlvm.Base.html#supportedLlvmVersionLowerBound"><span class="hs-identifier hs-var">supportedLlvmVersionLowerBound</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LlvmVersion
</span><a href="#local-6989586621681017338"><span class="hs-identifier hs-var">mb_ver</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>       </span><span class="hs-comment">-- run code generation</span><span>
</span><span id="line-84"></span><span>       </span><span id="local-6989586621681017314"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681017314"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; LlvmVersion -&gt; BufHandle -&gt; LlvmM a -&gt; IO a
forall a. DynFlags -&gt; LlvmVersion -&gt; BufHandle -&gt; LlvmM a -&gt; IO a
</span><a href="GHC.CmmToLlvm.Base.html#runLlvm"><span class="hs-identifier hs-var">runLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVersion
</span><a href="#local-6989586621681017315"><span class="hs-identifier hs-var">llvm_ver</span></a></span><span> </span><span class="annot"><span class="annottext">BufHandle
</span><a href="#local-6989586621681017341"><span class="hs-identifier hs-var">bufh</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmM a -&gt; IO a) -&gt; LlvmM a -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-85"></span><span>         </span><span class="annot"><span class="annottext">DynFlags -&gt; Stream LlvmM RawCmmGroup a -&gt; LlvmM a
forall a. DynFlags -&gt; Stream LlvmM RawCmmGroup a -&gt; LlvmM a
</span><a href="GHC.CmmToLlvm.html#llvmCodeGen%27"><span class="hs-identifier hs-var">llvmCodeGen'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017347"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a -&gt; Stream LlvmM RawCmmGroup a
forall a x. Stream IO a x -&gt; Stream LlvmM a x
</span><a href="GHC.CmmToLlvm.Base.html#liftStream"><span class="hs-identifier hs-var">liftStream</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681017345"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>       </span><span class="annot"><span class="annottext">BufHandle -&gt; IO ()
</span><a href="GHC.Utils.BufHandle.html#bFlush"><span class="hs-identifier hs-var">bFlush</span></a></span><span> </span><span class="annot"><span class="annottext">BufHandle
</span><a href="#local-6989586621681017341"><span class="hs-identifier hs-var">bufh</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>       </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681017314"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span id="local-6989586621681017544"><span class="annot"><a href="GHC.CmmToLlvm.html#llvmCodeGen%27"><span class="hs-identifier hs-type">llvmCodeGen'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier hs-type">Stream.Stream</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681017544"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681017544"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-92"></span><span id="llvmCodeGen%27"><span class="annot"><span class="annottext">llvmCodeGen' :: forall a. DynFlags -&gt; Stream LlvmM RawCmmGroup a -&gt; LlvmM a
</span><a href="GHC.CmmToLlvm.html#llvmCodeGen%27"><span class="hs-identifier hs-var hs-var">llvmCodeGen'</span></a></span></span><span> </span><span id="local-6989586621681017287"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017287"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681017286"><span class="annot"><span class="annottext">Stream LlvmM RawCmmGroup a
</span><a href="#local-6989586621681017286"><span class="hs-identifier hs-var">cmm_stream</span></a></span></span><span>
</span><span id="line-93"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-comment">-- Preamble</span><span>
</span><span id="line-94"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#renderLlvm"><span class="hs-identifier hs-var">renderLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681017284"><span class="hs-identifier hs-var">header</span></a></span><span>
</span><span id="line-95"></span><span>        </span><span class="annot"><span class="annottext">LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#ghcInternalFunctions"><span class="hs-identifier hs-var">ghcInternalFunctions</span></a></span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><span class="annottext">LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmMetaLlvmPrelude"><span class="hs-identifier hs-var">cmmMetaLlvmPrelude</span></a></span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-comment">-- Procedures</span><span>
</span><span id="line-99"></span><span>        </span><span id="local-6989586621681017281"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681017281"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Stream LlvmM RawCmmGroup a -&gt; (RawCmmGroup -&gt; LlvmM ()) -&gt; LlvmM a
forall (m :: * -&gt; *) a b.
Monad m =&gt;
Stream m a b -&gt; (a -&gt; m ()) -&gt; m b
</span><a href="GHC.Data.Stream.html#consume"><span class="hs-identifier hs-var">Stream.consume</span></a></span><span> </span><span class="annot"><span class="annottext">Stream LlvmM RawCmmGroup a
</span><a href="#local-6989586621681017286"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span> </span><span class="annot"><span class="annottext">RawCmmGroup -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.html#llvmGroupLlvmGens"><span class="hs-identifier hs-var">llvmGroupLlvmGens</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>        </span><span class="hs-comment">-- Declare aliases for forward references</span><span>
</span><span id="line-102"></span><span>        </span><span id="local-6989586621681017278"><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017278"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM LlvmOpts
</span><a href="GHC.CmmToLlvm.Base.html#getLlvmOpts"><span class="hs-identifier hs-var">getLlvmOpts</span></a></span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#renderLlvm"><span class="hs-identifier hs-var">renderLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; LlvmM ()) -&gt; (LlvmData -&gt; SDoc) -&gt; LlvmData -&gt; LlvmM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts -&gt; LlvmData -&gt; SDoc
</span><a href="GHC.CmmToLlvm.Ppr.html#pprLlvmData"><span class="hs-identifier hs-var">pprLlvmData</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017278"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmData -&gt; LlvmM ()) -&gt; LlvmM LlvmData -&gt; LlvmM ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmM LlvmData
</span><a href="GHC.CmmToLlvm.Base.html#generateExternDecls"><span class="hs-identifier hs-var">generateExternDecls</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-comment">-- Postamble</span><span>
</span><span id="line-106"></span><span>        </span><span class="annot"><span class="annottext">LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmUsedLlvmGens"><span class="hs-identifier hs-var">cmmUsedLlvmGens</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><span class="annottext">a -&gt; LlvmM a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681017281"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-109"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-110"></span><span>    </span><span class="annot"><a href="#local-6989586621681017284"><span class="hs-identifier hs-type">header</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span id="local-6989586621681017284"><span class="annot"><span class="annottext">header :: SDoc
</span><a href="#local-6989586621681017284"><span class="hs-identifier hs-var hs-var">header</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-112"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017272"><span class="annot"><span class="annottext">target :: String
</span><a href="#local-6989586621681017272"><span class="hs-identifier hs-var hs-var">target</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PlatformMisc -&gt; String
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformMisc_llvmTarget"><span class="hs-identifier hs-var hs-var">platformMisc_llvmTarget</span></a></span><span> </span><span class="annot"><span class="annottext">(PlatformMisc -&gt; String) -&gt; PlatformMisc -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; PlatformMisc
</span><a href="GHC.Driver.Session.html#platformMisc"><span class="hs-identifier hs-var hs-var">platformMisc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017287"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-113"></span><span>      </span><span class="hs-keyword">in</span><span>     </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;target datalayout = \&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmConfig -&gt; String -&gt; String
</span><a href="#local-6989586621681017269"><span class="hs-identifier hs-var">getDataLayout</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; LlvmConfig
</span><a href="GHC.Driver.Session.html#llvmConfig"><span class="hs-identifier hs-var hs-var">llvmConfig</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017287"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017272"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>         </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%2B%24"><span class="hs-operator hs-var">$+$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;target triple = \&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017272"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>    </span><span class="annot"><a href="#local-6989586621681017269"><span class="hs-identifier hs-type">getDataLayout</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#LlvmConfig"><span class="hs-identifier hs-type">LlvmConfig</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621681017269"><span class="annot"><span class="annottext">getDataLayout :: LlvmConfig -&gt; String -&gt; String
</span><a href="#local-6989586621681017269"><span class="hs-identifier hs-var hs-var">getDataLayout</span></a></span></span><span> </span><span id="local-6989586621681017266"><span class="annot"><span class="annottext">LlvmConfig
</span><a href="#local-6989586621681017266"><span class="hs-identifier hs-var">config</span></a></span></span><span> </span><span id="local-6989586621681017265"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017265"><span class="hs-identifier hs-var">target</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-118"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; [(String, LlvmTarget)] -&gt; Maybe LlvmTarget
forall a b. Eq a =&gt; a -&gt; [(a, b)] -&gt; Maybe b
</span><a href="../../base/src/GHC.List.html#lookup"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017265"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmConfig -&gt; [(String, LlvmTarget)]
</span><a href="GHC.Driver.Session.html#llvmTargets"><span class="hs-identifier hs-var hs-var">llvmTargets</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmConfig
</span><a href="#local-6989586621681017266"><span class="hs-identifier hs-var">config</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#LlvmTarget"><span class="hs-identifier hs-type">LlvmTarget</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">lDataLayout :: LlvmTarget -&gt; String
</span><a href="GHC.Driver.Session.html#lDataLayout"><span class="hs-identifier hs-var">lDataLayout</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681017260"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017260"><span class="hs-identifier hs-var">dl</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017260"><span class="hs-identifier hs-var">dl</span></a></span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><span class="annottext">Maybe LlvmTarget
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; String
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Failed to lookup LLVM data layout&quot;</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; String) -&gt; SDoc -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-121"></span><span>                   </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Target:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681017265"><span class="hs-identifier hs-var">target</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-122"></span><span>                   </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Available targets:&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span>
</span><span id="line-123"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((String, LlvmTarget) -&gt; SDoc) -&gt; [(String, LlvmTarget)] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc)
-&gt; ((String, LlvmTarget) -&gt; String) -&gt; (String, LlvmTarget) -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String, LlvmTarget) -&gt; String
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([(String, LlvmTarget)] -&gt; [SDoc])
-&gt; [(String, LlvmTarget)] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmConfig -&gt; [(String, LlvmTarget)]
</span><a href="GHC.Driver.Session.html#llvmTargets"><span class="hs-identifier hs-var hs-var">llvmTargets</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmConfig
</span><a href="#local-6989586621681017266"><span class="hs-identifier hs-var">config</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="annot"><a href="GHC.CmmToLlvm.html#llvmGroupLlvmGens"><span class="hs-identifier hs-type">llvmGroupLlvmGens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span id="llvmGroupLlvmGens"><span class="annot"><span class="annottext">llvmGroupLlvmGens :: RawCmmGroup -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.html#llvmGroupLlvmGens"><span class="hs-identifier hs-var hs-var">llvmGroupLlvmGens</span></a></span></span><span> </span><span id="local-6989586621681017256"><span class="annot"><span class="annottext">RawCmmGroup
</span><a href="#local-6989586621681017256"><span class="hs-identifier hs-var">cmm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span>        </span><span class="hs-comment">-- Insert functions into map, collect data</span><span>
</span><span id="line-129"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017242"><span class="annot"><span class="annottext">split :: GenCmmDecl b (map RawCmmStatics) (GenCmmGraph n)
-&gt; LlvmM (Maybe (Section, b))
</span><a href="#local-6989586621681017242"><span class="hs-identifier hs-var hs-var">split</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span id="local-6989586621681017240"><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681017240"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621681017239"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681017239"><span class="hs-identifier hs-var">d'</span></a></span></span><span> </span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Section, b) -&gt; LlvmM (Maybe (Section, b))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Section, b) -&gt; LlvmM (Maybe (Section, b)))
-&gt; Maybe (Section, b) -&gt; LlvmM (Maybe (Section, b))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Section, b) -&gt; Maybe (Section, b)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Section
</span><a href="#local-6989586621681017240"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681017239"><span class="hs-identifier hs-var">d'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>            </span><span class="annot"><a href="#local-6989586621681017242"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681017237"><span class="annot"><span class="annottext">map RawCmmStatics
</span><a href="#local-6989586621681017237"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621681017236"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681017236"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681017235"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681017235"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681017234"><span class="annot"><span class="annottext">GenCmmGraph n
</span><a href="#local-6989586621681017234"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-131"></span><span>              </span><span class="hs-comment">-- Set function type</span><span>
</span><span id="line-132"></span><span>              </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017233"><span class="annot"><span class="annottext">l' :: CLabel
</span><a href="#local-6989586621681017233"><span class="hs-identifier hs-var hs-var">l'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf map -&gt; map RawCmmStatics -&gt; Maybe RawCmmStatics
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenCmmGraph n -&gt; Label
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGraph n
</span><a href="#local-6989586621681017234"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">map RawCmmStatics
</span><a href="#local-6989586621681017237"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmStatics"><span class="hs-identifier hs-type">RawCmmStatics</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-133"></span><span>                         </span><span class="annot"><span class="annottext">Maybe RawCmmStatics
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681017236"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-134"></span><span>                         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmStaticsRaw"><span class="hs-identifier hs-type">CmmStaticsRaw</span></a></span><span> </span><span id="local-6989586621681017229"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681017229"><span class="hs-identifier hs-var">info_lbl</span></a></span></span><span> </span><span class="annot"><span class="annottext">[CmmStatic]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681017229"><span class="hs-identifier hs-var">info_lbl</span></a></span><span>
</span><span id="line-135"></span><span>              </span><span id="local-6989586621681017228"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017228"><span class="hs-identifier hs-var">lml</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; LlvmM LMString
</span><a href="GHC.CmmToLlvm.Base.html#strCLabel_llvm"><span class="hs-identifier hs-var">strCLabel_llvm</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681017233"><span class="hs-identifier hs-var">l'</span></a></span><span>
</span><span id="line-136"></span><span>              </span><span class="annot"><span class="annottext">LMString -&gt; LlvmType -&gt; LlvmM ()
forall key. Uniquable key =&gt; key -&gt; LlvmType -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#funInsert"><span class="hs-identifier hs-var">funInsert</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017228"><span class="hs-identifier hs-var">lml</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmType -&gt; LlvmM ()) -&gt; LlvmM LlvmType -&gt; LlvmM ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg] -&gt; LlvmM LlvmType
</span><a href="GHC.CmmToLlvm.Base.html#llvmFunTy"><span class="hs-identifier hs-var">llvmFunTy</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681017235"><span class="hs-identifier hs-var">live</span></a></span><span>
</span><span id="line-137"></span><span>              </span><span class="annot"><span class="annottext">Maybe (Section, b) -&gt; LlvmM (Maybe (Section, b))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Section, b)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-138"></span><span>        </span><span id="local-6989586621681017224"><span class="annot"><span class="annottext">[(Section, RawCmmStatics)]
</span><a href="#local-6989586621681017224"><span class="hs-identifier hs-var">cdata</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">([Maybe (Section, RawCmmStatics)] -&gt; [(Section, RawCmmStatics)])
-&gt; LlvmM [Maybe (Section, RawCmmStatics)]
-&gt; LlvmM [(Section, RawCmmStatics)]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe (Section, RawCmmStatics)] -&gt; [(Section, RawCmmStatics)]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmM [Maybe (Section, RawCmmStatics)]
 -&gt; LlvmM [(Section, RawCmmStatics)])
-&gt; LlvmM [Maybe (Section, RawCmmStatics)]
-&gt; LlvmM [(Section, RawCmmStatics)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
 -&gt; LlvmM (Maybe (Section, RawCmmStatics)))
-&gt; RawCmmGroup -&gt; LlvmM [Maybe (Section, RawCmmStatics)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
-&gt; LlvmM (Maybe (Section, RawCmmStatics))
forall {map :: * -&gt; *} {b}
       {n :: Extensibility -&gt; Extensibility -&gt; *}.
(IsMap map, KeyOf map ~ Label) =&gt;
GenCmmDecl b (map RawCmmStatics) (GenCmmGraph n)
-&gt; LlvmM (Maybe (Section, b))
</span><a href="#local-6989586621681017242"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="annot"><span class="annottext">RawCmmGroup
</span><a href="#local-6989586621681017256"><span class="hs-identifier hs-var">cmm</span></a></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span>        </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;llvm_datas_gen&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-141"></span><span>          </span><span class="annot"><span class="annottext">[(Section, RawCmmStatics)] -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmDataLlvmGens"><span class="hs-identifier hs-var">cmmDataLlvmGens</span></a></span><span> </span><span class="annot"><span class="annottext">[(Section, RawCmmStatics)]
</span><a href="#local-6989586621681017224"><span class="hs-identifier hs-var">cdata</span></a></span><span>
</span><span id="line-142"></span><span>        </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;llvm_procs_gen&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-143"></span><span>          </span><span class="annot"><span class="annottext">(GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
 -&gt; LlvmM ())
-&gt; RawCmmGroup -&gt; LlvmM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
-&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmLlvmGen"><span class="hs-identifier hs-var">cmmLlvmGen</span></a></span><span> </span><span class="annot"><span class="annottext">RawCmmGroup
</span><a href="#local-6989586621681017256"><span class="hs-identifier hs-var">cmm</span></a></span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- | Do LLVM code generation on all these Cmms data sections.</span><span>
</span><span id="line-147"></span><span class="hs-comment">--</span><span>
</span><span id="line-148"></span><span class="annot"><a href="GHC.CmmToLlvm.html#cmmDataLlvmGens"><span class="hs-identifier hs-type">cmmDataLlvmGens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#Section"><span class="hs-identifier hs-type">Section</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Cmm.html#RawCmmStatics"><span class="hs-identifier hs-type">RawCmmStatics</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span id="cmmDataLlvmGens"><span class="annot"><span class="annottext">cmmDataLlvmGens :: [(Section, RawCmmStatics)] -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmDataLlvmGens"><span class="hs-identifier hs-var hs-var">cmmDataLlvmGens</span></a></span></span><span> </span><span id="local-6989586621681017219"><span class="annot"><span class="annottext">[(Section, RawCmmStatics)]
</span><a href="#local-6989586621681017219"><span class="hs-identifier hs-var">statics</span></a></span></span><span>
</span><span id="line-151"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681017218"><span class="annot"><span class="annottext">[LlvmData]
</span><a href="#local-6989586621681017218"><span class="hs-identifier hs-var">lmdatas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Section, RawCmmStatics) -&gt; LlvmM LlvmData)
-&gt; [(Section, RawCmmStatics)] -&gt; LlvmM [LlvmData]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">(Section, RawCmmStatics) -&gt; LlvmM LlvmData
</span><a href="GHC.CmmToLlvm.Data.html#genLlvmData"><span class="hs-identifier hs-var">genLlvmData</span></a></span><span> </span><span class="annot"><span class="annottext">[(Section, RawCmmStatics)]
</span><a href="#local-6989586621681017219"><span class="hs-identifier hs-var">statics</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[LMGlobal]] -&gt; [LMGlobal]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span id="local-6989586621681017215"><span class="annot"><span class="annottext">[LMGlobal]
</span><a href="#local-6989586621681017215"><span class="hs-identifier hs-var">gs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681017214"><span class="annot"><span class="annottext">[[LlvmType]]
</span><a href="#local-6989586621681017214"><span class="hs-identifier hs-var">tss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LlvmData] -&gt; ([[LMGlobal]], [[LlvmType]])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmData]
</span><a href="#local-6989586621681017218"><span class="hs-identifier hs-var">lmdatas</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017209"><span class="annot"><span class="annottext">regGlobal :: LMGlobal -&gt; LlvmM ()
</span><a href="#local-6989586621681017209"><span class="hs-identifier hs-var hs-var">regGlobal</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Llvm.Types.html#LMGlobal"><span class="hs-identifier hs-type">LMGlobal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Llvm.Types.html#LMGlobalVar"><span class="hs-identifier hs-type">LMGlobalVar</span></a></span><span> </span><span id="local-6989586621681017206"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017206"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681017205"><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681017205"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LMSection
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LMAlign
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LMConst
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe LlvmStatic
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>                        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMString -&gt; LlvmType -&gt; LlvmM ()
forall key. Uniquable key =&gt; key -&gt; LlvmType -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#funInsert"><span class="hs-identifier hs-var">funInsert</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017206"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681017205"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-157"></span><span>           </span><span class="annot"><a href="#local-6989586621681017209"><span class="hs-identifier hs-var">regGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">LMGlobal
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; LlvmM ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>       </span><span class="annot"><span class="annottext">(LMGlobal -&gt; LlvmM ()) -&gt; [LMGlobal] -&gt; LlvmM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">LMGlobal -&gt; LlvmM ()
</span><a href="#local-6989586621681017209"><span class="hs-identifier hs-var">regGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">[LMGlobal]
</span><a href="#local-6989586621681017215"><span class="hs-identifier hs-var">gs</span></a></span><span>
</span><span id="line-159"></span><span>       </span><span id="local-6989586621681017204"><span class="annot"><span class="annottext">[[LMGlobal]]
</span><a href="#local-6989586621681017204"><span class="hs-identifier hs-var">gss'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LMGlobal -&gt; LlvmM [LMGlobal]) -&gt; [LMGlobal] -&gt; LlvmM [[LMGlobal]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">LMGlobal -&gt; LlvmM [LMGlobal]
</span><a href="GHC.CmmToLlvm.Base.html#aliasify"><span class="hs-identifier hs-var">aliasify</span></a></span><span> </span><span class="annot"><span class="annottext">([LMGlobal] -&gt; LlvmM [[LMGlobal]])
-&gt; [LMGlobal] -&gt; LlvmM [[LMGlobal]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[LMGlobal]
</span><a href="#local-6989586621681017215"><span class="hs-identifier hs-var">gs</span></a></span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>       </span><span id="local-6989586621681017202"><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017202"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM LlvmOpts
</span><a href="GHC.CmmToLlvm.Base.html#getLlvmOpts"><span class="hs-identifier hs-var">getLlvmOpts</span></a></span><span>
</span><span id="line-162"></span><span>       </span><span class="annot"><span class="annottext">SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#renderLlvm"><span class="hs-identifier hs-var">renderLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; LlvmM ()) -&gt; SDoc -&gt; LlvmM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts -&gt; LlvmData -&gt; SDoc
</span><a href="GHC.CmmToLlvm.Ppr.html#pprLlvmData"><span class="hs-identifier hs-var">pprLlvmData</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017202"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[LMGlobal]] -&gt; [LMGlobal]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[LMGlobal]]
</span><a href="#local-6989586621681017204"><span class="hs-identifier hs-var">gss'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[[LlvmType]] -&gt; [LlvmType]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[LlvmType]]
</span><a href="#local-6989586621681017214"><span class="hs-identifier hs-var">tss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-comment">-- | Complete LLVM code generation phase for a single top-level chunk of Cmm.</span><span>
</span><span id="line-165"></span><span class="annot"><a href="GHC.CmmToLlvm.html#cmmLlvmGen"><span class="hs-identifier hs-type">cmmLlvmGen</span></a></span><span> </span><span class="hs-glyph">::</span><span class="annot"><a href="GHC.Cmm.html#RawCmmDecl"><span class="hs-identifier hs-type">RawCmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span id="cmmLlvmGen"><span class="annot"><span class="annottext">cmmLlvmGen :: GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
-&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmLlvmGen"><span class="hs-identifier hs-var hs-var">cmmLlvmGen</span></a></span></span><span> </span><span id="local-6989586621681017200"><span class="annot"><span class="annottext">cmm :: GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><a href="#local-6989586621681017200"><span class="hs-identifier hs-var">cmm</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span>    </span><span class="hs-comment">-- rewrite assignments to global regs</span><span>
</span><span id="line-169"></span><span>    </span><span id="local-6989586621681017199"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017199"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017197"><span class="annot"><span class="annottext">fixed_cmm :: GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><a href="#local-6989586621681017197"><span class="hs-identifier hs-var hs-var">fixed_cmm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;llvm_fix_regs&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
-&gt; GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><a href="GHC.StgToCmm.CgUtils.html#fixStgRegisters"><span class="hs-identifier hs-var">fixStgRegisters</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681017199"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><a href="#local-6989586621681017200"><span class="hs-identifier hs-var">cmm</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span>    </span><span class="annot"><span class="annottext">DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#dumpIfSetLlvm"><span class="hs-identifier hs-var">dumpIfSetLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_opt_cmm"><span class="hs-identifier hs-var">Opt_D_dump_opt_cmm</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Optimised Cmm&quot;</span></span><span>
</span><span id="line-173"></span><span>      </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatCMM"><span class="hs-identifier hs-var">FormatCMM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RawCmmGroup -&gt; SDoc
forall d info g.
(Outputable d, Outputable info, Outputable g) =&gt;
GenCmmGroup d info g -&gt; SDoc
</span><a href="GHC.Cmm.Ppr.Decl.html#pprCmmGroup"><span class="hs-identifier hs-var">pprCmmGroup</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><a href="#local-6989586621681017197"><span class="hs-identifier hs-var">fixed_cmm</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span>    </span><span class="hs-comment">-- generate llvm code from cmm</span><span>
</span><span id="line-176"></span><span>    </span><span id="local-6989586621681017192"><span class="annot"><span class="annottext">[LlvmCmmDecl]
</span><a href="#local-6989586621681017192"><span class="hs-identifier hs-var">llvmBC</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM [LlvmCmmDecl] -&gt; LlvmM [LlvmCmmDecl]
forall a. LlvmM a -&gt; LlvmM a
</span><a href="GHC.CmmToLlvm.Base.html#withClearVars"><span class="hs-identifier hs-var">withClearVars</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmM [LlvmCmmDecl] -&gt; LlvmM [LlvmCmmDecl])
-&gt; LlvmM [LlvmCmmDecl] -&gt; LlvmM [LlvmCmmDecl]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
-&gt; LlvmM [LlvmCmmDecl]
</span><a href="GHC.CmmToLlvm.CodeGen.html#genLlvmProc"><span class="hs-identifier hs-var">genLlvmProc</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><a href="#local-6989586621681017197"><span class="hs-identifier hs-var">fixed_cmm</span></a></span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span>    </span><span class="hs-comment">-- pretty print</span><span>
</span><span id="line-179"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681017189"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681017189"><span class="hs-identifier hs-var">docs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681017188"><span class="annot"><span class="annottext">[[LlvmVar]]
</span><a href="#local-6989586621681017188"><span class="hs-identifier hs-var">ivars</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">([(SDoc, [LlvmVar])] -&gt; ([SDoc], [[LlvmVar]]))
-&gt; LlvmM [(SDoc, [LlvmVar])] -&gt; LlvmM ([SDoc], [[LlvmVar]])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[(SDoc, [LlvmVar])] -&gt; ([SDoc], [[LlvmVar]])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmM [(SDoc, [LlvmVar])] -&gt; LlvmM ([SDoc], [[LlvmVar]]))
-&gt; LlvmM [(SDoc, [LlvmVar])] -&gt; LlvmM ([SDoc], [[LlvmVar]])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(LlvmCmmDecl -&gt; LlvmM (SDoc, [LlvmVar]))
-&gt; [LlvmCmmDecl] -&gt; LlvmM [(SDoc, [LlvmVar])]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmCmmDecl -&gt; LlvmM (SDoc, [LlvmVar])
</span><a href="GHC.CmmToLlvm.Ppr.html#pprLlvmCmmDecl"><span class="hs-identifier hs-var">pprLlvmCmmDecl</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmCmmDecl]
</span><a href="#local-6989586621681017192"><span class="hs-identifier hs-var">llvmBC</span></a></span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span>    </span><span class="hs-comment">-- Output, note down used variables</span><span>
</span><span id="line-182"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#renderLlvm"><span class="hs-identifier hs-var">renderLlvm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681017189"><span class="hs-identifier hs-var">docs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>    </span><span class="annot"><span class="annottext">(LlvmVar -&gt; LlvmM ()) -&gt; [LlvmVar] -&gt; LlvmM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#markUsedVar"><span class="hs-identifier hs-var">markUsedVar</span></a></span><span> </span><span class="annot"><span class="annottext">([LlvmVar] -&gt; LlvmM ()) -&gt; [LlvmVar] -&gt; LlvmM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[[LlvmVar]] -&gt; [LlvmVar]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[LlvmVar]]
</span><a href="#local-6989586621681017188"><span class="hs-identifier hs-var">ivars</span></a></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="annot"><a href="GHC.CmmToLlvm.html#cmmLlvmGen"><span class="hs-identifier hs-var">cmmLlvmGen</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmDecl RawCmmStatics (LabelMap RawCmmStatics) CmmGraph
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; LlvmM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-188"></span><span class="hs-comment">-- | Generate meta data nodes</span><span>
</span><span id="line-189"></span><span class="hs-comment">--</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span class="annot"><a href="GHC.CmmToLlvm.html#cmmMetaLlvmPrelude"><span class="hs-identifier hs-type">cmmMetaLlvmPrelude</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span id="cmmMetaLlvmPrelude"><span class="annot"><span class="annottext">cmmMetaLlvmPrelude :: LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmMetaLlvmPrelude"><span class="hs-identifier hs-var hs-var">cmmMetaLlvmPrelude</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-193"></span><span>  </span><span id="local-6989586621681017185"><span class="annot"><span class="annottext">[MetaDecl]
</span><a href="#local-6989586621681017185"><span class="hs-identifier hs-var">metas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(((Unique, LMString, Maybe Unique) -&gt; LlvmM MetaDecl)
 -&gt; [(Unique, LMString, Maybe Unique)] -&gt; LlvmM [MetaDecl])
-&gt; [(Unique, LMString, Maybe Unique)]
-&gt; ((Unique, LMString, Maybe Unique) -&gt; LlvmM MetaDecl)
-&gt; LlvmM [MetaDecl]
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">((Unique, LMString, Maybe Unique) -&gt; LlvmM MetaDecl)
-&gt; [(Unique, LMString, Maybe Unique)] -&gt; LlvmM [MetaDecl]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unique, LMString, Maybe Unique)]
</span><a href="GHC.CmmToLlvm.Regs.html#stgTBAA"><span class="hs-identifier hs-var">stgTBAA</span></a></span><span> </span><span class="annot"><span class="annottext">(((Unique, LMString, Maybe Unique) -&gt; LlvmM MetaDecl)
 -&gt; LlvmM [MetaDecl])
-&gt; ((Unique, LMString, Maybe Unique) -&gt; LlvmM MetaDecl)
-&gt; LlvmM [MetaDecl]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681017182"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681017182"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681017181"><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017181"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681017180"><span class="annot"><span class="annottext">Maybe Unique
</span><a href="#local-6989586621681017180"><span class="hs-identifier hs-var">parent</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-comment">-- Generate / lookup meta data IDs</span><span>
</span><span id="line-195"></span><span>    </span><span id="local-6989586621681017179"><span class="annot"><span class="annottext">MetaId
</span><a href="#local-6989586621681017179"><span class="hs-identifier hs-var">tbaaId</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM MetaId
</span><a href="GHC.CmmToLlvm.Base.html#getMetaUniqueId"><span class="hs-identifier hs-var">getMetaUniqueId</span></a></span><span>
</span><span id="line-196"></span><span>    </span><span class="annot"><span class="annottext">Unique -&gt; MetaId -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#setUniqMeta"><span class="hs-identifier hs-var">setUniqMeta</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681017182"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">MetaId
</span><a href="#local-6989586621681017179"><span class="hs-identifier hs-var">tbaaId</span></a></span><span>
</span><span id="line-197"></span><span>    </span><span id="local-6989586621681017176"><span class="annot"><span class="annottext">Maybe MetaId
</span><a href="#local-6989586621681017176"><span class="hs-identifier hs-var">parentId</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM (Maybe MetaId)
-&gt; (Unique -&gt; LlvmM (Maybe MetaId))
-&gt; Maybe Unique
-&gt; LlvmM (Maybe MetaId)
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe MetaId -&gt; LlvmM (Maybe MetaId)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe MetaId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; LlvmM (Maybe MetaId)
</span><a href="GHC.CmmToLlvm.Base.html#getUniqMeta"><span class="hs-identifier hs-var">getUniqMeta</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Unique
</span><a href="#local-6989586621681017180"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-comment">-- Build definition</span><span>
</span><span id="line-199"></span><span>    </span><span class="annot"><span class="annottext">MetaDecl -&gt; LlvmM MetaDecl
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(MetaDecl -&gt; LlvmM MetaDecl) -&gt; MetaDecl -&gt; LlvmM MetaDecl
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MetaId -&gt; MetaExpr -&gt; MetaDecl
</span><a href="GHC.Llvm.MetaData.html#MetaUnnamed"><span class="hs-identifier hs-var">MetaUnnamed</span></a></span><span> </span><span class="annot"><span class="annottext">MetaId
</span><a href="#local-6989586621681017179"><span class="hs-identifier hs-var">tbaaId</span></a></span><span> </span><span class="annot"><span class="annottext">(MetaExpr -&gt; MetaDecl) -&gt; MetaExpr -&gt; MetaDecl
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[MetaExpr] -&gt; MetaExpr
</span><a href="GHC.Llvm.MetaData.html#MetaStruct"><span class="hs-identifier hs-var">MetaStruct</span></a></span><span> </span><span class="annot"><span class="annottext">([MetaExpr] -&gt; MetaExpr) -&gt; [MetaExpr] -&gt; MetaExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-200"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe MetaId
</span><a href="#local-6989586621681017176"><span class="hs-identifier hs-var">parentId</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-201"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681017171"><span class="annot"><span class="annottext">MetaId
</span><a href="#local-6989586621681017171"><span class="hs-identifier hs-var">p</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">LMString -&gt; MetaExpr
</span><a href="GHC.Llvm.MetaData.html#MetaStr"><span class="hs-identifier hs-var">MetaStr</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017181"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MetaId -&gt; MetaExpr
</span><a href="GHC.Llvm.MetaData.html#MetaNode"><span class="hs-identifier hs-var">MetaNode</span></a></span><span> </span><span class="annot"><span class="annottext">MetaId
</span><a href="#local-6989586621681017171"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-202"></span><span>              </span><span class="hs-comment">-- As of LLVM 4.0, a node without parents should be rendered as</span><span>
</span><span id="line-203"></span><span>              </span><span class="hs-comment">-- just a name on its own. Previously `null` was accepted as the</span><span>
</span><span id="line-204"></span><span>              </span><span class="hs-comment">-- name.</span><span>
</span><span id="line-205"></span><span>              </span><span class="annot"><span class="annottext">Maybe MetaId
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">LMString -&gt; MetaExpr
</span><a href="GHC.Llvm.MetaData.html#MetaStr"><span class="hs-identifier hs-var">MetaStr</span></a></span><span> </span><span class="annot"><span class="annottext">LMString
</span><a href="#local-6989586621681017181"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-206"></span><span>  </span><span id="local-6989586621681017168"><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017168"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM LlvmOpts
</span><a href="GHC.CmmToLlvm.Base.html#getLlvmOpts"><span class="hs-identifier hs-var">getLlvmOpts</span></a></span><span>
</span><span id="line-207"></span><span>  </span><span class="annot"><span class="annottext">SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#renderLlvm"><span class="hs-identifier hs-var">renderLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; LlvmM ()) -&gt; SDoc -&gt; LlvmM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts -&gt; [MetaDecl] -&gt; SDoc
</span><a href="GHC.Llvm.Ppr.html#ppLlvmMetas"><span class="hs-identifier hs-var">ppLlvmMetas</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017168"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="annot"><span class="annottext">[MetaDecl]
</span><a href="#local-6989586621681017185"><span class="hs-identifier hs-var">metas</span></a></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- | Marks variables as used where necessary</span><span>
</span><span id="line-211"></span><span class="hs-comment">--</span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span class="annot"><a href="GHC.CmmToLlvm.html#cmmUsedLlvmGens"><span class="hs-identifier hs-type">cmmUsedLlvmGens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.Base.html#LlvmM"><span class="hs-identifier hs-type">LlvmM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span id="cmmUsedLlvmGens"><span class="annot"><span class="annottext">cmmUsedLlvmGens :: LlvmM ()
</span><a href="GHC.CmmToLlvm.html#cmmUsedLlvmGens"><span class="hs-identifier hs-var hs-var">cmmUsedLlvmGens</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-comment">-- LLVM would discard variables that are internal and not obviously</span><span>
</span><span id="line-217"></span><span>  </span><span class="hs-comment">-- used if we didn't provide these hints. This will generate a</span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-comment">-- definition of the form</span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-comment">--   @llvm.used = appending global [42 x i8*] [i8* bitcast &lt;var&gt; to i8*, ...]</span><span>
</span><span id="line-221"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-222"></span><span>  </span><span class="hs-comment">-- Which is the LLVM way of protecting them against getting removed.</span><span>
</span><span id="line-223"></span><span>  </span><span id="local-6989586621681017166"><span class="annot"><span class="annottext">[LlvmVar]
</span><a href="#local-6989586621681017166"><span class="hs-identifier hs-var">ivars</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM [LlvmVar]
</span><a href="GHC.CmmToLlvm.Base.html#getUsedVars"><span class="hs-identifier hs-var">getUsedVars</span></a></span><span>
</span><span id="line-224"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681017164"><span class="annot"><span class="annottext">cast :: LlvmVar -&gt; LlvmStatic
</span><a href="#local-6989586621681017164"><span class="hs-identifier hs-var hs-var">cast</span></a></span></span><span> </span><span id="local-6989586621681017163"><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681017163"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmStatic -&gt; LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMBitc"><span class="hs-identifier hs-var">LMBitc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVar -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticPointer"><span class="hs-identifier hs-var">LMStaticPointer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmVar -&gt; LlvmVar
</span><a href="GHC.Llvm.Types.html#pVarLift"><span class="hs-identifier hs-var">pVarLift</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681017163"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="GHC.Llvm.Types.html#i8Ptr"><span class="hs-identifier hs-var">i8Ptr</span></a></span><span>
</span><span id="line-225"></span><span>      </span><span id="local-6989586621681017158"><span class="annot"><span class="annottext">ty :: LlvmType
</span><a href="#local-6989586621681017158"><span class="hs-identifier hs-var hs-var">ty</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; LlvmType -&gt; LlvmType
</span><a href="GHC.Llvm.Types.html#LMArray"><span class="hs-identifier hs-var">LMArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LlvmVar] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmVar]
</span><a href="#local-6989586621681017166"><span class="hs-identifier hs-var">ivars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="GHC.Llvm.Types.html#i8Ptr"><span class="hs-identifier hs-var">i8Ptr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>      </span><span id="local-6989586621681017155"><span class="annot"><span class="annottext">usedArray :: LlvmStatic
</span><a href="#local-6989586621681017155"><span class="hs-identifier hs-var hs-var">usedArray</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LlvmStatic] -&gt; LlvmType -&gt; LlvmStatic
</span><a href="GHC.Llvm.Types.html#LMStaticArray"><span class="hs-identifier hs-var">LMStaticArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LlvmVar -&gt; LlvmStatic) -&gt; [LlvmVar] -&gt; [LlvmStatic]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar -&gt; LlvmStatic
</span><a href="#local-6989586621681017164"><span class="hs-identifier hs-var">cast</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmVar]
</span><a href="#local-6989586621681017166"><span class="hs-identifier hs-var">ivars</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681017158"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-227"></span><span>      </span><span id="local-6989586621681017153"><span class="annot"><span class="annottext">sectName :: LMSection
</span><a href="#local-6989586621681017153"><span class="hs-identifier hs-var hs-var">sectName</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMString -&gt; LMSection
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(LMString -&gt; LMSection) -&gt; LMString -&gt; LMSection
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;llvm.metadata&quot;</span></span><span>
</span><span id="line-228"></span><span>      </span><span id="local-6989586621681017151"><span class="annot"><span class="annottext">lmUsedVar :: LlvmVar
</span><a href="#local-6989586621681017151"><span class="hs-identifier hs-var hs-var">lmUsedVar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMString
-&gt; LlvmType
-&gt; LlvmLinkageType
-&gt; LMSection
-&gt; LMAlign
-&gt; LMConst
-&gt; LlvmVar
</span><a href="GHC.Llvm.Types.html#LMGlobalVar"><span class="hs-identifier hs-var">LMGlobalVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; LMString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;llvm.used&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LlvmType
</span><a href="#local-6989586621681017158"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmLinkageType
</span><a href="GHC.Llvm.Types.html#Appending"><span class="hs-identifier hs-var">Appending</span></a></span><span> </span><span class="annot"><span class="annottext">LMSection
</span><a href="#local-6989586621681017153"><span class="hs-identifier hs-var">sectName</span></a></span><span> </span><span class="annot"><span class="annottext">LMAlign
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">LMConst
</span><a href="GHC.Llvm.Types.html#Constant"><span class="hs-identifier hs-var">Constant</span></a></span><span>
</span><span id="line-229"></span><span>      </span><span id="local-6989586621681017148"><span class="annot"><span class="annottext">lmUsed :: LMGlobal
</span><a href="#local-6989586621681017148"><span class="hs-identifier hs-var hs-var">lmUsed</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LlvmVar -&gt; Maybe LlvmStatic -&gt; LMGlobal
</span><a href="GHC.Llvm.Types.html#LMGlobal"><span class="hs-identifier hs-var">LMGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmVar
</span><a href="#local-6989586621681017151"><span class="hs-identifier hs-var">lmUsedVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LlvmStatic -&gt; Maybe LlvmStatic
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmStatic
</span><a href="#local-6989586621681017155"><span class="hs-identifier hs-var">usedArray</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>  </span><span id="local-6989586621681017147"><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017147"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LlvmM LlvmOpts
</span><a href="GHC.CmmToLlvm.Base.html#getLlvmOpts"><span class="hs-identifier hs-var">getLlvmOpts</span></a></span><span>
</span><span id="line-231"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[LlvmVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LlvmVar]
</span><a href="#local-6989586621681017166"><span class="hs-identifier hs-var">ivars</span></a></span><span>
</span><span id="line-232"></span><span>     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; LlvmM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>     </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; LlvmM ()
</span><a href="GHC.CmmToLlvm.Base.html#renderLlvm"><span class="hs-identifier hs-var">renderLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; LlvmM ()) -&gt; SDoc -&gt; LlvmM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts -&gt; LlvmData -&gt; SDoc
</span><a href="GHC.CmmToLlvm.Ppr.html#pprLlvmData"><span class="hs-identifier hs-var">pprLlvmData</span></a></span><span> </span><span class="annot"><span class="annottext">LlvmOpts
</span><a href="#local-6989586621681017147"><span class="hs-identifier hs-var">opts</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">LMGlobal
</span><a href="#local-6989586621681017148"><span class="hs-identifier hs-var">lmUsed</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-234"></span></pre></body></html>